package com.hualian.coupon.service.impl;

import com.hualian.coupon.mapper.AdminMapper;
import com.hualian.coupon.pojo.Admin;
import com.hualian.coupon.service.AdminService;
import com.hualian.coupon.util.MD5Util;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author Lxd
 * @Description TODO 超级管理员功能
 * @date 2020/10/23 15:14
 * @Version 1.0
 */
@Service("adminService")
public class AdminServiceImpl implements AdminService {

    @Resource
    AdminMapper adminMapper;

    @Override
    public Admin login(String phone, String psw) {
        Admin admin = new Admin();
        admin.setPassword(MD5Util.encode(psw));
        admin.setPhone(phone);
        return adminMapper.selectOne(admin);
    }
}
